home *** CD-ROM | disk | FTP | other *** search
/ comtecelectrical.ca / www.comtecelectrical.ca.tar / www.comtecelectrical.ca / infobots / Backup / MSOCache / All Users / 90000409-6000-11D3-8CFE-0150048383C9 / O1561415.CAB / MSOHLP11.CHM_1033 / html / sexpandcollapse.js < prev    next >
Text File  |  2003-05-28  |  2KB  |  75 lines

  1. ∩╗┐function ExpandDiv(theDivName)
  2. {
  3.     if (null == theDivName || typeof(theDivName) == "undefined") return; var theDiv = allDivs[theDivName]; if (null == theDiv || typeof(theDiv) == "undefined") return;
  4.     theDiv.style.display = "block";
  5.  
  6.     var thePic = allImages[theDivName + "_img"];
  7.     if (null != thePic && typeof(thePic) != "undefined")
  8.         thePic.src = "/global/images/default.aspx?AssetID=ZA790050011033";
  9. }
  10.  
  11. function CollapseDiv(theDivName)
  12. {
  13.     if (null == theDivName || typeof(theDivName) == "undefined") return; var theDiv = allDivs[theDivName]; if (null == theDiv || typeof(theDiv) == "undefined") return;
  14.     theDiv.style.display = "none";
  15.  
  16.     var thePic = allImages[theDivName + "_img"];
  17.     if (null != thePic && typeof(thePic) != "undefined")
  18.         thePic.src = "/global/images/default.aspx?AssetID=ZA790050001033";
  19. }
  20.  
  21. function ToggleDiv(theDivName)
  22. {
  23.     if (null == theDivName || typeof(theDivName) == "undefined") return; var theDiv = allDivs[theDivName]; if (null == theDiv || typeof(theDiv) == "undefined") return;
  24.  
  25.     if (theDiv.style.display.toUpperCase() == "NONE")
  26.         ExpandDiv(theDivName);
  27.     else
  28.         CollapseDiv(theDivName);
  29. }
  30.  
  31. function AlterAllDivs(displayStyle)
  32. {
  33.     if (null == allDivs || typeof(allDivs) == "undefined")
  34.         return;        
  35.  
  36.     for (i=0; i < allDivs.length; i++)
  37.         {
  38.         if (0 == allDivs[i].id.indexOf("divExpCollAsst_")) 
  39.             if (displayStyle == "block")
  40.                 ExpandDiv(allDivs[i].id);
  41.             else
  42.                 CollapseDiv(allDivs[i].id);
  43.         }
  44. }
  45.  
  46. function ToggleAllDivs()
  47. {
  48.     if (fExpanded)
  49.     {
  50.         AlterAllDivs("none");
  51.  
  52.         if (null != imgShowAll && typeof(imgShowAll) != "undefined")
  53.             imgShowAll.src = "/global/images/default.aspx?AssetID=ZA790050031033"
  54.     }
  55.     else
  56.     {
  57.         AlterAllDivs("block");
  58.  
  59.         if (null != imgShowAll && typeof(imgShowAll) != "undefined")
  60.             imgShowAll.src = "/global/images/default.aspx?AssetID=ZA790050021033"
  61.     }
  62.  
  63.     fExpanded = !fExpanded;
  64. }
  65.  
  66. function ToggleAll()
  67. {
  68.     ToggleAllDivs();
  69. }
  70.  
  71. var allDivs = document.body.getElementsByTagName("DIV");
  72. var allImages = document.body.getElementsByTagName("IMG");
  73. var fExpanded = false;
  74. var imgShowAll = allImages["picHeader"];
  75.